package org.jeecg.modules.demo.demoTest2.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import javax.swing.text.html.parser.Entity;
import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;

/**
 * @Author yw
 * @Date 2021/3/3 14:39
 */
@Data
@TableName("demo_user")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="demo_user对象", description="demo用户")
public class DemoUser implements Serializable {
    private static final long serialVersionUID = 1L;

    /**主键*/
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private java.lang.String id;

    /**创建人*/
    @ApiModelProperty(value = "创建人")
    private java.lang.String createBy;
    /**创建日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private java.util.Date createTime;
    /**更新人*/
    @ApiModelProperty(value = "更新人")
    private java.lang.String updateBy;
    /**更新日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private java.util.Date updateTime;

    @Excel(name = "下拉框", width = 15, dicCode = "sex")
    @Dict(dicCode = "sex")
    @ApiModelProperty(value = "下拉框")
    private java.lang.String sex;

    /**用户名*/
    @Excel(name = "用户名", width = 15)
    @ApiModelProperty(value = "用户名")
    private java.lang.String username;

    /**用户编码*/
    @Excel(name = "用户编码", width = 15)
    @ApiModelProperty(value = "用户编码")
    private java.lang.String usercode;

    /**电话*/
    @Excel(name = "电话", width = 15)
    @ApiModelProperty(value = "电话")
    private java.lang.String phone;

    /**住址*/
    @Excel(name = "住址", width = 15)
    @ApiModelProperty(value = "住址")
    private java.lang.String address;

    /**生日*/
    @Excel(name = "生日", width = 15)
    @ApiModelProperty(value = "生日")
    private java.lang.Double birthday;

    /*public void setBirthday() throws Exception{
        if(this.birthday.indexOf("-")!=-1){
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            String time=birthday;
            try{
                Date date = (Date) format.parse(time);
                this.birthday = String.valueOf(date);
            }catch (Exception e){
                e.printStackTrace();
            }
        }
    }
    public String getBirthday() {
        String txt=this.birthday;
        System.out.println("ts:"+birthday);
        if(this.birthday!=null&&this.birthday.indexOf("-")==-1){
            Date d = new Date( Long.parseLong(birthday));
            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
            txt=sf.format(d);
        }
        return txt;
    }
*/


}
